package com.ruoyi.system.api.service.impl;

import com.alibaba.fastjson.JSON;
import com.ruoyi.common.config.Global;
import com.ruoyi.system.api.ResponseWithData;
import com.ruoyi.system.api.service.EngineerManageService;
import com.ruoyi.system.api.service.PokeRequestServe;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ClassName SparePartsServiceImpl
 * @Description: TODO
 * @Author wlf
 * @Date 2020/3/2
 * @Version V1.0
 **/
@Service
public class EngineerManageServiceImpl implements EngineerManageService {

    private static final Logger log = LoggerFactory.getLogger(EngineerManageServiceImpl.class);

    @Autowired
    private PokeRequestServe pokeRequestServe;

    /** 配置文件 */
    @Autowired
    private Global global;

    @Override
    public ResponseWithData<?> selectTlEngineer(String teamleaderId) {
        String ccServerUrl = global.getCcServerUrl();
        StringBuffer url = new StringBuffer();
        url.append(ccServerUrl);
        url.append("getEngineerByTL.asmx/getEngineerByTLHandle?Teamleader_id=").append(teamleaderId);

        return pokeRequestServe.transGet(url.toString(), "获取TL名下工程师接口", "getEngineerByTL");
    }
}
